package com.common.sub.util;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class ExFunction {
	
	
	public static String URLDecoder(String s,String enc){
        try {
			return URLDecoder.decode(s, enc);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		};
		return null;  
    }
	@SuppressWarnings("deprecation")
	public static String URLDecoder(String s){
        return URLDecoder.decode(s);
    }
	
	public static String URLencoder(String s,String enc){
		try {
			return URLEncoder.encode(s, enc);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	@SuppressWarnings("deprecation")
	public static String URLencoder(String s){
		return URLEncoder.encode(s);
	}

}
